//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _PLAYER_EMITTER_H
#define _PLAYER_EMITTER_H
//
#include <global.h>
#include <osg/Referenced>
#include "particleparam.h"
#include "model/emittertemplate_fwd.h"
#include "particlesystem_fwd.h"
#include "controller_fwd.h"
//
namespace player
{
class Emitter:public osg::Referenced
{
//disabled
public:
   Emitter(const Emitter&);
   Emitter&operator=(const Emitter&);
//construction
public:
   Emitter();
   ~Emitter();
   void init_setup(Controller *p_controller,const model::EmitterTemplate *p_emitter_template);
//operations
public:
   void trigger(const ParticleParam &p_param)const;
protected:
   void get_final_velocity(const ParticleParam &p_param_in,const osg::Vec3 &p_position,const osg::Vec3 &p_angle,const osg::Vec3 &p_angular_velocity,osg::Vec3 &p_final_velocity)const;
//data
public:
   const Controller *get_controller()const;
protected:
   const model::EmitterTemplate *emitter_template;
   Controller *controller;
};
//
inline const Controller *Emitter::get_controller()const
{
   return controller;
}
}
//
#endif
